import pandas as pd

df = pd.DataFrame({
    "语文": [77, 59, 46],
    "数学": [70, 88, 49],
    "英语": [79, 90, 32]
}, index=["a1", "a2", "a3"])

print("原始DataFrame:\n", df)

df1 = df.query('语文<60 and 数学<60 and 英语<60')
print("df1:\n", df1)

df2 = pd.DataFrame({
    "物理": [40, 45],
    "化学": [35, 30]
}, index=["a2", "a3"])
print("df2:\n", df2)

df_concat = pd.concat([df1, df2], axis=1)
print("按列拼接后的DataFrame:\n", df_concat)